<!-- 子页面>左边 -->
<template>
    <div class="childLeft-container">
        <component v-if="isRouterAlive" :is="pageName" :parames="transData"></component>
    </div>
</template>

<script>
import MapEquipment from "./LeftCompt/MapEquipment"; //设备一张图
import ReceivingPolice from "./LeftCompt/ReceivingPolice"; //接处警
import Inspection from "./LeftCompt/Inspection"; //巡检
import CellCenter from './LeftCompt/CellCenterLeft' // 呼叫中心
import RectificationDangers from "./LeftCompt/RectificationDangers"; //隐患整改
import Maintenance from "./LeftCompt/Maintenance"; //隐患整改
export default {
    name: "ChildLeft",
    components: {
        MapEquipment,
        ReceivingPolice,
        CellCenter,
        Inspection,
        RectificationDangers,
        Maintenance
    },
    props:{
        parames:{
            required: true
        }
    },
    data() {
        return {
            pageName:'',
            transData:{},
            isRouterAlive: true
        };
    },
    created: function() {
        window.FunList.refreshChidLeft = this.freshPage
        if(this.parames){
            this.freshPage(this.parames)
        }
    },
    methods: {
        freshPage(param){
            if(this.pageName == param.pageName){
                this.reload ()
            }
            this.transData = param
            this.pageName = param.pageName
        },
        reload () {
            this.isRouterAlive = false
            this.$nextTick(() => (this.isRouterAlive = true))
        }   
    }
};
</script>

<style scoped rel="stylesheet/scss" lang="scss">
.childLeft-container{
    width: 100%;
    height: 100%;
}
</style>
